package First;
import javax.accessibility.AccessibleRelationSet;
import java.util.ArrayList;
import java.util.List;

public class Third3 {
    //------------------
    public class School{
        private List<Student>studentList;
        private List<Department>departmentList;
        public School(){
            studentList  = new ArrayList<>();
            departmentList = new ArrayList<>();
        }
        public void addDepartment(Department department) {
            departmentList.add(department);
        }

        public void addSubject(Student student) {
            studentList.add(student);
        }
    }
    //--------------
    public class Department{
        private List<Subject>subjectList;
        private List<Instructor>instructorList;
        public Department(){
            subjectList  = new ArrayList<>();
            instructorList = new ArrayList<>();
        }
        public void addInstructor(Instructor instructor) {
            instructorList.add(instructor);
        }

        public void addSubject(Subject subject) {
            subjectList.add(subject);
        }
    }
    //------------------------------
    public class Student{
        private List<Subject> subjects;
        public Student() {
            subjects = new ArrayList<>();
        }
        public void addSubject(Subject subject) {
            subjects.add(subject);
        }

    }

    public class Instructor{
        private List<Subject>subjectList;
        private String name;
        public Instructor (String name){
            subjectList  = new ArrayList<>();
            this.name = name;
        }
        public void addSubject(Subject subject) {
            subjectList.add(subject);
        }
    }
    public class Subject{
        private String name;
        public Subject(String name){
            this.name = name;
        }
    }
}
